Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

378
Views
"npm start" shows "Unhandled promise rejection" error

I am new to NodeJS and NPM.

When I run npm start within a NodeJS project, the following errors occurred:

Starting the development server...

(node:9417) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

What does this error mean? How should debug this problem?

$ grep start package.json 
    "start": "react-scripts start",

$ npm -v
3.10.10
$ node -v
v6.10.1

$ npm ls react-scripts
reference-apps@2.3.1 /home/li/sample
└── react-scripts@0.5.1  
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I guess your code like below

new Promise(function(resolve, reject){
    reject(0)
}).then()

when you run the code above, you will get “Unhandled promise rejection”.

with Promise/A+ standard #point-21. A promise must provide a then method to access its current or eventual value or reason.

you'd better write code as below

promise.then(onFulfilled, onRejected)

the other way to avoid the issue, you can listen the unhandledRejection event with process

process.on('unhandledRejection', (reason, p) => {
  console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
  // application specific logging, throwing an error, or other logic here
});  
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!